import { ItemInfo } from "./info/ItemInfo";
import { ECategory } from "../../../Message/Public/ECategory";
import { EEquip } from "../../../Message/Public/EEquip";
import { TItem } from "../../../Message/Db/Tables/TItem";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { DescConfig } from "./DescConfig";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { Log } from "../../../com/gengine/debug/Log";
import { TItemWeapon } from "../../../Message/Db/Tables/TItemWeapon";
import { TItemPet } from "../../../Message/Db/Tables/TItemPet";
import { TItemMount } from "../../../Message/Db/Tables/TItemMount";
import { TItemUpdate } from "../../../Message/Db/Tables/TItemUpdate";
import { DoubleJewelData } from "../view/equipment/data/DoubleJewelData";
import { JSON } from "../../../com/mui/serialization/json/JSON";
import { Cache } from "../cache/Cache";
import { JSONHelper } from "../../../com/mui/serialization/json/JSONHelper";
import { ItemData } from "./info/ItemData";
type int = number;
//class ItemConfig
    
    export  class ItemConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            this._extendItemMap = new Map<any, any> /* flash.utils.Dictionary */();
            this._itemUpdateMap = new Map<any, any> /* flash.utils.Dictionary */();
            this._itemPetMap = new Map<any, any> /* flash.utils.Dictionary */();
            this._itemUpdateArray = [];
            if (ItemConfig._instance != null) 
            {
                throw new Error(" ResConfig 单例 ");
            }
            this.init();
            return;
        }

        public getSkillRuneItemInfoByEffectAndLevel(arg1: int, arg2: int): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (loc1.item.category != ECategory._ECategoryRune) 
                {
                    continue;
                }
                if (!(loc1.item.effect <= arg1 && loc1.item.effectEx >= arg1 && loc1.item.itemLevel == arg2)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getItemByLevelAndItemLevel(arg1: int, arg2: int, arg3: int=-1, arg4: int=1, arg5: int=1): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == arg1 && loc1.item.type == arg2 && (arg3 == -1 || loc1.item.bind == arg3))) 
                {
                    continue;
                }
                if (!(arg4 == loc1.item.level && arg5 == loc1.item.itemLevel)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getModelName(arg1: string): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == ECategory._ECategoryEquip || loc1.item.category == ECategory._ECategoryMount)) 
                {
                    continue;
                }
                if (loc1.item.category == ECategory._ECategoryEquip) 
                {
                    if (loc1.item.type == EEquip._EEquipFashion || loc1.item.type == EEquip._EEquipWing || loc1.item.type == EEquip._EEquipFashionWeapon || loc1.item.type == EEquip._EEquipFootPrint || loc1.item.type == EEquip._EEquipBubble || loc1.item.type == EEquip._EEquipSurround || loc1.item.type == EEquip._EEquipWaistBelt || loc1.item.type == EEquip._EEquipElf) 
                    {
                        if (loc1.modelId == arg1) 
                        {
                            return loc1;
                        }
                    }
                    continue;
                }
                if (loc1.modelId != arg1) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getPropByCateTypeColor(arg1: int, arg2: int, arg3: int): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == arg1 && loc1.item.type == arg2 && loc1.item.color == arg3)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public static get instance(): ItemConfig
        {
            if (ItemConfig._instance == null) 
            {
                ItemConfig._instance = new ItemConfig();
            }
            return ItemConfig._instance;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=arg1;
            for(loc3 of loc5) 
            {
                if (loc3 == null) 
                {
                    continue;
                }
                loc2 = new ItemInfo();
                loc1 = new TItem();
                loc1.code = loc3.code;
                loc1.icon = StringHelper.getString(loc3.icon);
                loc1.codeUnbind = loc3.codeUnbind;
                loc1.name = StringHelper.getString(loc3.name);
                loc1.category = loc3.category;
                loc1.type = loc3.type;
                loc1.level = loc3.level;
                loc1.itemLevel = loc3.itemLevel;
                loc1.effect = loc3.effect;
                loc1.effectEx = loc3.effectEx;
                loc1.bind = loc3.bind;
                loc1.career = loc3.career;
                loc1.sell = loc3.sell;
                loc1.sellPrice = loc3.sellPrice;
                loc1.sellUnit = loc3.sellUnit;
                loc1.color = loc3.color;
                loc1.overlay = loc3.overlay;
                loc1.existTime = loc3.existTime;
                loc1.existSpecial = loc3.existSpecial;
                loc1.cdTime = loc3.cdTime;
                loc1.useType = loc3.useType;
                loc1.gasValue = loc3.gasValue;
                loc1.mountExp = loc3.mountExp;
                loc1.descId = loc3.descId;
                if (loc1.descId > 0) 
                {
                    loc1.descStr = DescConfig.instance.getDescAlyzObj(loc1.descId, loc1);
                }
                else 
                {
                    loc1.descStr = StringHelper.getString(loc3.descStr) + StringHelper.getString(loc3.descStrExtend);
                }
                loc2.item = loc1;
                this._map[loc1.code] = loc2;
            }
            return;
        }

        public init(): void
        {
            var loc1=null;
            loc1 = ConfigManager.instance.getJSONByFileName("t_item.json");
            this.write(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_item_weapon.json");
            this.writeWeapon(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_item_mount.json");
            this.writeMount(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_item_update.json");
            this.writeUpdate(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_item_pet.json");
            this.writePet(loc1);
            Log.debug("初始化 itemConfig");
            return;
        }

        /* internal  */writeWeapon(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=arg1;
            for(loc3 of loc5) 
            {
                loc1 = new ItemInfo();
                loc2 = new TItemWeapon();
                loc2.code = loc3.code;
                loc2.icon = StringHelper.getString(loc3.icon);
                loc2.codeUnbind = loc3.codeUnbind;
                loc2.name = StringHelper.getString(loc3.name);
                loc2.category = loc3.category;
                loc2.type = loc3.type;
                loc2.level = loc3.level;
                loc2.itemLevel = loc3.itemLevel;
                loc2.effect = loc3.effect;
                loc2.effectEx = loc3.effectEx;
                loc2.bind = loc3.bind;
                loc2.career = loc3.career;
                loc2.sell = loc3.sell;
                loc2.sellPrice = loc3.sellPrice;
                loc2.sellUnit = loc3.sellUnit;
                loc2.color = loc3.color;
                loc2.overlay = loc3.overlay;
                loc2.existTime = loc3.existTime;
                loc2.existSpecial = loc3.existSpecial;
                loc2.cdTime = loc3.cdTime;
                loc2.descStr = StringHelper.getString(loc3.descStr);
                loc2.careerSkillType = loc3.careerSkillType;
                loc2.attackDistance = loc3.attackDistance;
                loc2.attackSpeed = loc3.attackSpeed;
                loc2.basePhysicalAttack = loc3.basePhysicalAttack;
                loc2.baseMagicAttack = loc3.baseMagicAttack;
                loc2.basePhysicalDefense = loc3.basePhysicalDefense;
                loc2.baseMagicDefense = loc3.baseMagicDefense;
                loc2.basePower = loc3.basePower;
                loc2.baseAgile = loc3.baseAgile;
                loc2.baseHabitus = loc3.baseHabitus;
                loc2.baseBrains = loc3.baseBrains;
                loc2.baseSpiritual = loc3.baseSpiritual;
                loc2.baseLife = loc3.baseLife;
                loc2.baseHit = loc3.baseHit;
                loc2.baseJouk = loc3.baseJouk;
                loc2.basePass = loc3.basePass;
                loc2.basePhysicalCrit = loc3.basePhysicalCrit;
                loc2.baseMagicCrit = loc3.baseMagicCrit;
                loc2.baseToughness = loc3.baseToughness;
                loc2.baseRelief = loc3.baseRelief;
                loc2.life = loc3.life;
                loc2.physicalAttack = loc3.physicalAttack;
                loc2.magicAttack = loc3.magicAttack;
                loc2.mana = loc3.mana;
                loc2.power = loc3.power;
                loc2.agile = loc3.agile;
                loc2.habitus = loc3.habitus;
                loc2.brains = loc3.brains;
                loc2.spiritual = loc3.spiritual;
                loc2.physicalDefense = loc3.physicalDefense;
                loc2.magicDefense = loc3.magicDefense;
                loc2.hit = loc3.hit;
                loc2.jouk = loc3.jouk;
                loc2.pass = loc3.pass;
                loc2.block = loc3.block;
                loc2.physicalCrit = loc3.physicalCrit;
                loc2.magicCrit = loc3.magicCrit;
                loc2.speededUp = loc3.speededUp;
                loc2.toughness = loc3.toughness;
                loc2.relief = loc3.relief;
                loc2.prefix = loc3.prefix;
                loc2.prefixMax = loc3.prefixMax;
                loc2.loss = loc3.loss;
                loc2.repair = loc3.repair;
                loc2.durable = loc3.durable;
                loc2.durableUpper = loc3.durableUpper;
                loc2.hide = loc3.hide;
                loc2.specialRepairNeedItem = loc3.specialRepairNeedItem;
                loc2.specialRepairNeedAmount = loc3.specialRepairNeedAmount;
                loc2.suit = loc3.suit;
                loc2.modelId = StringHelper.getString(loc3.modelId);
                loc2.gasValue = loc3.gasValue;
                loc2.mountExp = loc3.mountExp;
                loc2.harmDeeper = loc3.harmDeeper;
                loc2.harmLower = loc3.harmLower;
                this._map[loc2.code] = loc1;
                loc1.extend = loc2;
                loc1.item = this.getTItemByWeapon(loc2);
            }
            return;
        }

        /* internal  */writePet(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=arg1;
            for(loc3 of loc5) 
            {
                loc1 = new ItemInfo();
                loc2 = new TItemPet();
                loc2.code = loc3.code;
                loc2.icon = StringHelper.getString(loc3.icon);
                loc2.codeUnbind = loc3.codeUnbind;
                loc2.name = StringHelper.getString(loc3.name);
                loc2.category = loc3.category;
                loc2.type = loc3.type;
                loc2.level = loc3.level;
                loc2.effect = loc3.effect;
                loc2.effectEx = loc3.effectEx;
                loc2.bind = loc3.bind;
                loc2.career = loc3.career;
                loc2.sell = loc3.sell;
                loc2.sellPrice = loc3.sellPrice;
                loc2.sellUnit = loc3.sellUnit;
                loc2.color = loc3.color;
                loc2.overlay = loc3.overlay;
                loc2.existTime = loc3.existTime;
                loc2.existSpecial = loc3.existSpecial;
                loc2.cdTime = loc3.cdTime;
                loc2.descStr = StringHelper.getString(loc3.descStr);
                loc2.fightType = loc3.fightType;
                loc2.needLevel = loc3.needLevel;
                loc2.modelId = loc3.modelId;
                loc2.avatarId = loc3.avatarId;
                loc2.talentConfig = StringHelper.getString(loc3.talentConfig);
                loc2.maxEnergy = loc3.maxEnergy;
                loc2.initLifeSpan = loc3.initLifeSpan;
                loc2.spiritConfig = StringHelper.getString(loc3.spiritConfig);
                loc2.growthConfig = StringHelper.getString(loc3.growthConfig);
                loc2.speed = loc3.speed;
                loc2.attackDistance = loc3.attackDistance;
                loc2.attackSpeed = loc3.attackSpeed;
                loc2.initPower = loc3.initPower;
                loc2.initAgility = loc3.initAgility;
                loc2.initConstitution = loc3.initConstitution;
                loc2.initBrains = loc3.initBrains;
                loc2.initSpiritual = loc3.initSpiritual;
                loc2.initRelief = loc3.initRelief;
                loc2.initHit = loc3.initHit;
                loc2.initCrit = loc3.initCrit;
                loc2.initPass = loc3.initPass;
                loc2.initSpeededUp = loc3.initSpeededUp;
                loc2.initBlock = loc3.initBlock;
                loc2.initJouk = loc3.initJouk;
                loc2.initToughness = loc3.initToughness;
                loc2.skill1 = loc3.skill1;
                loc2.skill2 = loc3.skill2;
                loc2.skill3 = loc3.skill3;
                loc2.talentConfig = StringHelper.getString(loc3.talentConfig);
                loc2.talkId = loc3.talkId;
                loc2.gasValue = loc3.gasValue;
                this._map[loc2.code] = loc1;
                loc1.extend = loc2;
                loc1.item = this.getTItemByPet(loc2);
            }
            return;
        }

        /* internal  */getTItemByWeapon(arg1: TItemWeapon): TItem
        {
            var loc1=new TItem();
            loc1.code = arg1.code;
            loc1.codeUnbind = arg1.codeUnbind;
            loc1.icon = arg1.icon;
            loc1.name = arg1.name;
            loc1.category = arg1.category;
            loc1.type = arg1.type;
            loc1.level = arg1.level;
            loc1.itemLevel = arg1.itemLevel;
            loc1.effect = arg1.effect;
            loc1.effectEx = arg1.effectEx;
            loc1.bind = arg1.bind;
            loc1.career = arg1.career;
            loc1.sell = arg1.sell;
            loc1.sellPrice = arg1.sellPrice;
            loc1.sellUnit = arg1.sellUnit;
            loc1.color = arg1.color;
            loc1.overlay = arg1.overlay;
            loc1.existTime = arg1.existTime;
            loc1.existSpecial = arg1.existSpecial;
            loc1.cdTime = arg1.cdTime;
            loc1.descStr = arg1.descStr;
            loc1.gasValue = arg1.gasValue;
            loc1.mountExp = arg1.mountExp;
            return loc1;
        }

        /* internal  */getTItemByPet(arg1: TItemPet): TItem
        {
            var loc1=new TItem();
            loc1.code = arg1.code;
            loc1.icon = arg1.icon;
            loc1.name = arg1.name;
            loc1.category = arg1.category;
            loc1.type = arg1.type;
            loc1.level = arg1.level;
            loc1.effect = arg1.effect;
            loc1.effectEx = arg1.effectEx;
            loc1.bind = arg1.bind;
            loc1.career = arg1.career;
            loc1.sell = arg1.sell;
            loc1.sellPrice = arg1.sellPrice;
            loc1.sellUnit = arg1.sellUnit;
            loc1.color = arg1.color;
            loc1.overlay = arg1.overlay;
            loc1.existTime = arg1.existTime;
            loc1.existSpecial = arg1.existSpecial;
            loc1.cdTime = arg1.cdTime;
            loc1.descStr = arg1.descStr;
            loc1.gasValue = arg1.gasValue;
            return loc1;
        }

        /* internal  */writeMount(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=arg1;
            for(loc3 of loc5) 
            {
                loc1 = new ItemInfo();
                loc2 = new TItemMount();
                loc2.code = loc3.code;
                loc2.icon = StringHelper.getString(loc3.icon);
                loc2.codeUnbind = loc3.codeUnbind;
                loc2.name = StringHelper.getString(loc3.name);
                loc2.category = loc3.category;
                loc2.type = loc3.type;
                loc2.level = loc3.level;
                loc2.effect = loc3.effect;
                loc2.effectEx = loc3.effectEx;
                loc2.bind = loc3.bind;
                loc2.career = loc3.career;
                loc2.sell = loc3.sell;
                loc2.sellPrice = loc3.sellPrice;
                loc2.sellUnit = loc3.sellUnit;
                loc2.color = loc3.color;
                loc2.overlay = loc3.overlay;
                loc2.existTime = loc3.existTime;
                loc2.existSpecial = loc3.existSpecial;
                loc2.cdTime = loc3.cdTime;
                loc2.descStr = StringHelper.getString(loc3.descStr);
                loc2.personAmount = loc3.personAmount;
                loc2.initLevel = loc3.initLevel;
                loc2.talentLower = loc3.talentLower;
                loc2.talentUpper = loc3.talentUpper;
                loc2.skill1 = loc3.skill1;
                loc2.skill2 = loc3.skill2;
                loc2.skill3 = loc3.skill3;
                loc2.skill4 = loc3.skill4;
                loc2.modelId = StringHelper.getString(loc3.modelId);
                loc2.costTime = loc3.costTime;
                loc2.baseSpeed = loc3.baseSpeed;
                loc2.baseSpirit = loc3.baseSpirit;
                loc2.gasValue = loc3.gasValue;
                loc2.life = StringHelper.getString(loc3.life);
                loc2.jouk = StringHelper.getString(loc3.jouk);
                loc2.magicDefense = StringHelper.getString(loc3.magicDefense);
                loc2.physicalDefense = StringHelper.getString(loc3.physicalDefense);
                loc2.power = StringHelper.getString(loc3.power);
                loc2.agile = StringHelper.getString(loc3.agile);
                loc2.habitus = StringHelper.getString(loc3.habitus);
                loc2.brains = StringHelper.getString(loc3.brains);
                loc2.spiritual = StringHelper.getString(loc3.spiritual);
                loc2.magicCrit = StringHelper.getString(loc3.magicCrit);
                loc2.physicalCrit = StringHelper.getString(loc3.magicCrit);
                loc2.toughness = StringHelper.getString(loc3.toughness);
                this._map[loc2.code] = loc1;
                loc1.item = this.getTItemByMount(loc2);
                loc1.extend = loc2;
            }
            return;
        }

        /* internal  */getTItemByMount(arg1: TItemMount): TItem
        {
            var loc1=new TItem();
            loc1.code = arg1.code;
            loc1.codeUnbind = arg1.codeUnbind;
            loc1.icon = arg1.icon;
            loc1.name = arg1.name;
            loc1.category = arg1.category;
            loc1.type = arg1.type;
            loc1.level = arg1.level;
            loc1.effect = arg1.effect;
            loc1.effectEx = arg1.effectEx;
            loc1.bind = arg1.bind;
            loc1.career = arg1.career;
            loc1.sell = arg1.sell;
            loc1.sellPrice = arg1.sellPrice;
            loc1.sellUnit = arg1.sellUnit;
            loc1.color = arg1.color;
            loc1.overlay = arg1.overlay;
            loc1.existTime = arg1.existTime;
            loc1.existSpecial = arg1.existSpecial;
            loc1.cdTime = arg1.cdTime;
            loc1.descStr = arg1.descStr;
            loc1.gasValue = arg1.gasValue;
            return loc1;
        }

        /* internal  */writeUpdate(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TItemUpdate();
                loc1.id = loc2.id;
                loc1.operation = StringHelper.getString(loc2.operation);
                loc1.condition = StringHelper.getString(loc2.condition);
                this._itemUpdateMap[loc1.id] = loc1;
                this._itemUpdateArray.push(loc1);
            }
            return;
        }

        public parseObj(arg1: Object): DoubleJewelData
        {
            var loc2=null;
            var loc1=new DoubleJewelData();
            var loc3=0;
            var loc4=arg1;
            for (loc2 in loc4) 
            {
                if (loc1[loc2] == null) 
                {
                    continue;
                }
                loc1[loc2] = arg1[loc2];
                if (!(!(loc1[loc2 + "UnB"] == null) && this._map[loc1[loc2]].item.bind == 1)) 
                {
                    continue;
                }
                loc1[loc2 + "UnB"] = this._map[loc1[loc2]].item.codeUnbind;
            }
            return loc1;
        }

        public getTItemUpdateById(arg1: int): TItemUpdate
        {
            return this._itemUpdateMap[arg1];
        }

        public getInfoByCode(arg1: int): ItemInfo
        {
            return this._map[arg1];
        }

        public getColorMount(arg1: string, arg2: int): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.modelId == arg1 && loc1.item.color == arg2)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getUpdateInfo(arg1: string, arg2: int=0): TItemUpdate
        {
            if (arg1 == ItemConfig.WeaponStrengthen) 
            {
                return this._itemUpdateMap[arg2];
            }
            if (arg1 == ItemConfig.WeaponRefine) 
            {
                return this._itemUpdateMap[arg2 + 10];
            }
            if (arg1 == ItemConfig.WeaponMakeHole) 
            {
                return this._itemUpdateMap[arg2 + 20];
            }
            if (arg1 == ItemConfig.EmbedJewel) 
            {
                return this._itemUpdateMap[24];
            }
            if (arg1 == ItemConfig.RemoveJewel) 
            {
                return this._itemUpdateMap[25];
            }
            if (arg1 == ItemConfig.ComposeJewel) 
            {
                return this._itemUpdateMap[26];
            }
            if (arg1 == ItemConfig.WeaponRecast) 
            {
                return this._itemUpdateMap[27];
            }
            if (arg1 == ItemConfig.ComposeJewel2Cost) 
            {
                return this._itemUpdateMap[129];
            }
            return null;
        }

        public getPetUpdateInfo(arg1: string, arg2: int=0): Object
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            if (arg1 != ItemConfig.RefreshPetGrowth) 
            {
                if (arg1 == ItemConfig.StrengthPetSpirit) 
                {
                    if (arg2 >= 0 && arg2 < 20) 
                    {
                        loc3 = arg2 + 68;
                        if (arg2 == 20) 
                        {
                            loc3 = arg2 + 67;
                        }
                        loc2 = this._itemUpdateMap[loc3];
                    }
                }
            }
            else if (arg2 >= 0 && arg2 < 40) 
            {
                loc3 = arg2 + 28;
                if (arg2 == 40) 
                {
                    loc3 = arg2 + 27;
                }
                loc2 = this._itemUpdateMap[loc3];
            }
            if (loc2) 
            {
                loc1 = JSON.deserialize(loc2.condition);
            }
            return loc1;
        }

        public getPetWarehouseExpansionCost(): Array<any>
        {
            var loc3=null;
            var loc4=0;
            var loc1=[];
            var loc2="";
            var loc5=0;
            var loc6=this._itemUpdateMap;
            for(loc3 of loc6) 
            {
                if (loc3.operation != "PetWarehouseExpansionCost") 
                {
                    continue;
                }
                loc2 = loc3.condition;
            }
            loc1 = loc2.split("#");
            loc4 = 0;
            while (loc4 < loc1.length) 
            {
                if (loc1[loc4] == "") 
                {
                    loc1.splice(loc4, 1);
                }
                else 
                {
                    loc1[loc4] = (loc1[loc4] as string).split(",");
                    loc1[loc4][0] = parseInt(loc1[loc4][0]);
                    loc1[loc4][1] = parseInt(loc1[loc4][1]);
                }
                ++loc4;
            }
            return loc1;
        }

        public getItemUpdateArrayByOperation(arg1: string): Array<any>
        {
            var loc2=null;
            var loc1=[];
            var loc3=0;
            while (loc3 < this._itemUpdateArray.length) 
            {
                loc2 = this._itemUpdateArray[loc3];
                if (arg1 == loc2.operation) 
                {
                    loc1.push(loc2);
                }
                ++loc3;
            }
            return loc1;
        }

        public getItemInfoByParams(arg1: int, arg2: int, arg3: int, arg4: int=-1, arg5: int=-1, arg6: int=-1): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == arg1 && loc1.item.type == arg2 && loc1.item.bind == arg3 && (arg4 == -1 || loc1.item.level == arg4) && (arg5 == -1 || loc1.item.color == arg5) && (arg6 == -1 || loc1.item.itemLevel == arg6))) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getDoubleJewelRecipe(): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._itemUpdateMap;
            for(loc1 of loc3) 
            {
                if (loc1.operation != "ComposeJewel2") 
                {
                    continue;
                }
                Cache.instance.jewel.recipe.push(this.parseObj(JSONHelper.deserialize(loc1.condition)));
            }
            return;
        }

        public getDoubleJewelInfo(arg1: ItemData, arg2: ItemData): ItemInfo
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=Cache.instance.jewel.recipe;
            for(loc2 of loc4) 
            {
                if (!((arg1.itemInfo.item.code == loc2.material_jewel1 || arg1.itemInfo.item.code == loc2.material_jewel2 || arg1.itemInfo.item.code == loc2.material_jewel1UnB || arg1.itemInfo.item.code == loc2.material_jewel2UnB) && (arg2.itemInfo.item.code == loc2.material_jewel1 || arg2.itemInfo.item.code == loc2.material_jewel2 || arg2.itemInfo.item.code == loc2.material_jewel1UnB || arg2.itemInfo.item.code == loc2.material_jewel2UnB))) 
                {
                    continue;
                }
                if (arg1.itemInfo.item.bind == 1 || arg2.itemInfo.item.bind == 1) 
                {
                    loc1 = this._map[loc2.target];
                }
                if (!(arg1.itemInfo.item.bind == 0 && arg2.itemInfo.item.bind == 0)) 
                {
                    continue;
                }
                loc1 = this._map[loc2.targetUnB];
            }
            return loc1;
        }

        public getPropsByType(arg1: int): Array<any>
        {
            var loc2=null;
            var loc1=new Array<any>();
            var loc3=0;
            var loc4=this._map;
            for(loc2 of loc4) 
            {
                if (!(loc2.item.category == ECategory._ECategoryProp && loc2.item.type == arg1)) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            return loc1;
        }

        public getPropsByCategory(arg1: int): Array<any>
        {
            var loc2=null;
            var loc1=new Array<any>();
            var loc3=0;
            var loc4=this._map;
            for(loc2 of loc4) 
            {
                if (loc2.item.category != arg1) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            return loc1;
        }

        public getMagicWeaponByCategory(arg1: int): Array<any>
        {
            var loc2=null;
            var loc1=new Array<any>();
            var loc3=0;
            var loc4=this._map;
            for(loc2 of loc4) 
            {
                if (!(loc2.item.category == arg1 && loc2.item.type > 5)) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            return loc1;
        }

        public getEquipByParams(arg1: int, arg2: int, arg3: int): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == ECategory._ECategoryEquip && loc1.item.type == arg2 && loc1.item.bind == arg3)) 
                {
                    continue;
                }
                if ((loc1.extend as TItemWeapon).suit != arg1) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getItemByType(arg1: int, arg2: int, arg3: int=-1, arg4: int=-1): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == arg1 && loc1.item.type == arg2 && (arg3 == -1 || loc1.item.bind == arg3))) 
                {
                    continue;
                }
                if (!(arg4 == -1 || arg4 == loc1.item.effect)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getItemByTypeAndLevel(arg1: int, arg2: int, arg3: int=-1, arg4: int=1): ItemInfo
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.item.category == arg1 && loc1.item.type == arg2 && (arg3 == -1 || loc1.item.bind == arg3))) 
                {
                    continue;
                }
                if (arg4 != loc1.item.itemLevel) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getAllItemMap(): Map<any, any> /* flash.utils.Dictionary */
        {
            return this._map;
        }

        public getItemsByJudge(arg1: Function=null): Array<any>
        {
            var loc2=null;
            var loc1=new Array<any>();
            var loc3=0;
            var loc4=this._map;
            for(loc2 of loc4) 
            {
                if (!(arg1 == null || arg1.call(null, loc2) == true)) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            return loc1;
        }

        public static /* const */WeaponRefine: string="ItemConfig.WeaponRefine";

        public static /* const */WeaponStrengthen: string="ItemConfig.WeaponStrengthen";

        public static /* const */EmbedJewel: string="ItemConfig.EmbedJewel";

        public static /* const */RemoveJewel: string="ItemConfig.RemoveJewel";

        public static /* const */ComposeJewel: string="ItemConfig.ComposeJewel";

        public static /* const */ComposeJewel2Cost: string="ItemConfig.ComposeJewel2Cost";

        public static /* const */WeaponRecast: string="ItemConfig.WeaponRecast";

        public static /* const */WeaponMakeHole: string="ItemConfig.WeaponMakeHole";

        public static /* const */RefreshPetGrowth: string="ItemConfig.RefreshPetGrowth";

        public static /* const */StrengthPetSpirit: string="ItemConfig.StrengthPetSpirit";

        public static /* const */RefreshMountGrow: string="ItemConfig.RefreshMountGrow";

        public static /* const */MountGrowLevelAdd: string="ItemConfig.MountGrowLevelAdd";

        public static /* const */PetEquipPrefix: string="ItemConfig.PetEquipPrefix";

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_extendItemMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_itemUpdateMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_itemPetMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_itemUpdateArray: Array<any>;

        /* internal */ static /* var */_instance: ItemConfig;
    }
